<!DOCTYPE html>

<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="user-scalable=no, width=device-width"/>
        <link rel="stylesheet" href="css/jquery.mobile-1.4.4/jquery.mobile-1.4.4.min.css">
        <link rel="stylesheet" href="css/jquery.mobile-1.4.4/jquery.mobile.structure-1.4.4.min.css">
        <link rel="stylesheet" href="css/jquery.mobile-1.4.4/jquery.mobile.inline-png-1.4.4.min.css">
        <link rel="stylesheet" href="css/jquery.mobile-1.4.4/jquery.mobile.inline-svg-1.4.4.min.css">
        <link rel="stylesheet" href="css/jquery.mobile-1.4.4/jquery.mobile.external-png-1.4.4.min.css">
        <!-- Choix du thème -->
        <link rel="stylesheet" href="css/bootstrap/bootstrap.min.css">
        <link rel="stylesheet" href="css/bootstrap/jquery.mobile.icons.min.css">
        <!-- JavaScript -->
        <script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
        <script type="text/javascript" src="js/jquery.mobile-1.4.4.min.js"></script>
        <script type="text/javascript" src="js/datebox/jqm-datebox.core.js"></script>
        <script type="text/javascript" src="js/datebox/jqm-datebox.mode.datebox.js"></script>
        <title></title>
    </head>
    <body >
        <div data-role="page" id="Projet"  data-dom-cahe=true>
            
            <?php $prevlink='choixClasse.php'; $headerText = 'Choix des projets'; include 'includes/header.php'; ?>

            <div data-role="content">
                <?php
                session_start();
                $idUser = $_SESSION["id"];
                // Montrer les erreurs
                /*ini_set('display_errors', 1);
                ini_set('display_startup_errors', 1);
                error_reporting(-1);*/


                if (isset($_POST['classe'])) {
                    
                    $idClasse = $_POST['classe'];
                    require_once '../controller/ProjetManager.php';
                    include_once '../model/config.php';
                    $manager = new ProjetManager($bdd);
                    $list = $manager->getListProjet($idClasse,$idUser);
                    echo '<form action="Projet.php" method="post">';
                    foreach ($list as $projet) {
                        $id = $projet->getIdProjet();
                        $libele=utf8_encode($projet->getLibelleProjet()); 
                        echo'<label><input type="checkbox" name="choix[]" value="'.$id.'"/>'.$libele.'</label>';                       
                    }
                    echo '<button  data-transition="flip" id="submit" class="ui-btn ui-btn-b ui-btn-corner-all" name="valider" value="valider">Valider</button';
                    echo '</form>'; 
                } 
                    ?>
                
                
            </div>

            <div data-role="footer" data-theme="e" data-position="fixed" >
                <h1> &copy INSA TOULOUSE</h1>
            </div>
        </div>
    </body>
</html>
